#include "fault_detection.h"

extern FaultDetection g_faultDetection;

void InitFaultDetection(){
    g_faultDetection.errCount = 0;
    g_faultDetection.overTemperture = false;  
    g_faultDetection.overInCurrent = false;   
    g_faultDetection.overOutCurrent = false;  
    g_faultDetection.overOutVoltage = false;  
    g_faultDetection.lowInVoltage = false;    
    g_faultDetection.lowOutVoltage = false;   
    g_faultDetection.lowSystemVoltage = false;
}

void FaultDetection(OperatingData *operating_data){
    if (operating_data->temp < 6.6f )           // 温度超过100
    {
        g_faultDetection.overTemperture = true;
        g_faultDetection.errCount++;

    }else
    {
        g_faultDetection.overTemperture = false; 
    }
}